<!--
**********************************************************
* @Author: 张小平
* @Date:   2024-05-01
* @Email:  qqshuqian@163.com
* @Last modified: 最后修改日期
* @Description: 文件描述
**********************************************************
-->
<template>
  <div>
    <el-input @keyup.enter.native="handleLogin" v-model="username" auto-complete="off"  v-on:blur="handleBlur"
              placeholder="请输入用户名">
      <i slot="prefix" class="icon-yonghu"></i>
    </el-input>

    <basic-video ref="video" @dataChange=""
                 :width="350">
    </basic-video>
  </div>

</template>

<script>
import { mapGetters } from "vuex";
import basicVideo from '@/framework-core/components/basic-video/main.vue'
export default {
  components: {
    basicVideo
  },
  data () {
    return {
      username: ""

    }
  },
  created () {

  },
  computed: {
    ...mapGetters(["tagWel"])
  },
  methods: {
    handleBlur(){
      if(this.username){
        setTimeout(() => {
          this.handleLogin()
        }, 6000)
    }
    },
    handleDataChange(base64){
      this.handleLogin(base64)
    },
    handleLogin (base64) {
      this.$store.dispatch("LoginByFace", {username: this.username, face: base64}).then(() => {
        this.$router.push(this.tagWel);
      });
    }
  }
}
</script>

<style>
</style>
